<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <h:form id="criarForm" styleClass="container_24 clearfix" >
                <h3 class="title">Coleta Dados</h3>
                <p:growl id="messages" showDetail="false" autoUpdate="true"  />

                <p:panel styleClass="grid_24 clearfix withoutBorder">
                    <h4 class="title">Ação</h4>
                    <p:outputLabel value="Ação" styleClass="grid_3" for="situacao" />
                    <div class="grid_13">
                        <p:selectOneMenu id="situacao" panelStyle="width:150px;"
                                         style="width: 99% !important;"
                                         value="#{managerCriarColetaDados.situacaoColetaDados.statusColetaDados}" >
                            <f:selectItem itemLabel="" itemValue="" />
                            <f:selectItems value="#{managerUtilitario.statusColetaDados}"/>
                        </p:selectOneMenu> 
                    </div>
                    <div class="clear"/>
                    <p:outputLabel value="Responsável" styleClass="grid_3" for="usuario"/>
                    <p:autoComplete id="usuario" value="#{managerCriarColetaDados.usuario}" var="item"
                                    forceSelection="true" dropdown="true" styleClass="grid_13"
                                    itemValue="#{item}" itemLabel="#{item.nome}" panelStyle="max-height:200px;"
                                    completeMethod="#{managerUtilitario.autocompleteUsuario}" 
                                    converter="usuarioconverter">
                    </p:autoComplete>
                    <div class="clear"/>
                    <h4 class="title">Quadra</h4>
                    <p:outputLabel value="Setor" styleClass="grid_3" for="setor" />
                    <div class="grid_8">
                        <p:selectOneMenu id="setor" panelStyle="width:150px;" converter="setorconverter"
                                         value="#{managerCriarQuadra.quadra.setor}" 
                                         required="true" >
                            <f:selectItem itemLabel="" itemValue="" />
                            <f:selectItems value="#{managerUtilitario.setor}"/>
                        </p:selectOneMenu> 
                    </div>

                    <p:outputLabel value="Número" styleClass="grid_3" for="numero"/>
                    <p:inputText id="numero" styleClass="grid_7" value="#{managerCriarColetaDados.quadra.numero}"
                                 required="true"  />
                    
                    
                </p:panel>

                <br/>
                <div class="buttonAction">
                    <p:commandButton value="Salvar" icon="ui-icon-disk"
                                     update="@form"
                                     actionListener="#{managerCriarColetaDados.salvar()}"
                                     styleClass="ui-priority-primary" />
                    <p:button href="index.xhtml" value="Cancelar"  icon="ui-icon-trash" />
                </div >
            </h:form>
        </ui:define>
    </ui:composition>

</html>
